import { Commit } from "vuex";

interface ICrazyNav {
  id: number;
  title: string;
  px: number;
  appPic: string;
  goodNum: number;
  smallPic: string;
}
interface ICraztList {
  id: number;
  yuanjia: number;
  jiage: number;
  istmall: number;
  xiaoliang: number;
  yongjin: number;
  quanNum: number;
  quanOver: number;
  quanJine: number;
  huodongType: number;
  pic: string;
  sellerId: string;
  renqi: number;
  isHaitao: number;
  salesNum: string;
  createTime: string;
  reachPrice: number;
  market_group: [];
  mallDesc: string;
  dtitle: string;
}
interface IState {
  crazyNav: Partial<ICrazyNav>[];
  craztList: Partial<ICraztList>[];
}

interface ICrazy {
  namespaced: boolean;
  state: IState;
  actions: {
    getNav: ({ commit }: { commit: Commit }) => void;
    getlist: (
      { commit }: { commit: Commit },
      { params }: { params: { type: number; cId: number } }
    ) => void;
  };
  mutations: {
    GET_NAV: (
      state: IState,
      action: { type: string; payload: ICrazyNav[] }
    ) => void;
    GET_LIST: (
      state: IState,
      action: { type: string; payload: ICraztList[] }
    ) => void;
  };
}

export { ICrazy, IState };
